<% @curr_attendances.group_by(&:meeting_id).sort.each do |meeting_id, attendances| %>

<div id="meeting-roster">
<h1>Meeting Check-In Roster</h1>
<% @meeting = Meeting.find(meeting_id) rescue nil %>

<% unless @meeting.nil? %>
<h2><%= @meeting.instance.event.date.strftime('%m/%d/%Y') rescue nil %> | <%= @meeting.instance.instance_type.name rescue nil %></h2>
<h3>Meeting #<%= meeting_id rescue nil %>: <%= @meeting.group.name rescue nil %></h3>


<table class="report-summary">
	<tr>
		<th>Total Checked In</th>
		<th>Participants</th>
		<th>Staff</th>
	</tr>
	<tr>
		<td><%= @meeting.checkedin_count rescue nil %></td>
		<td><%= @meeting.participant_checkedin_count rescue nil %></td>
		<td><%= @meeting.staff_checkedin_count rescue nil %></td>
	</tr>
</table>
<br>
<strong>People Currently Checked In:</strong>
<table class="report-sub-summary">
<tr>
	<th>Person</th>
	<th>CheckIn Time</th>
	<th>Security Code</th>
	<th>Checked In As</th>
</tr>
<% @meeting.active_attendances.each do |a| %>
<tr>
	<td><%= a.person.full_name rescue nil %></td>
	<td><%= a.checkin_time.strftime('%I:%M') rescue nil  %></td>
	<td><%= a.security_code rescue nil %></td>
	<td><%= a.checkin_type.name rescue nil %></td>
</tr>
<% end %>
</table>	
</div>
<% end %>
<% end %>